package math;

public class Vector2{
    public float x;
    public float y;

    public Vector2 uv;
    public Vector3 v3;

    public Vector2(float x, float y){
        this.x = x;
        this.y = y;
    }

    public Vector2(){
        this.x = 0;
        this.y = 0;
    }

    public Vector2 subVectors(Vector2 a, Vector2 b){
        this.x = a.x - b.x;
        this.y = a.y - b.y;

        return this;
    }

    public Vector2 clone(){
        return new Vector2( this.x, this.y );
    }

    public Vector2 addScaledVector(Vector2 v, float s ){
        this.x += v.x * s;
        this.y += v.y * s;

        return this;
    }

    public Vector2 addVectors(Vector2 a, Vector2 b ) {

        this.x = a.x + b.x;
        this.y = a.y + b.y;

        return this;

    }

    public Vector2 multiplyScalar( float scalar ) {

        this.x *= scalar;
        this.y *= scalar;

        return this;

    }
}
